import http from '@/utils/request'

const apiBefore = 'web/bots'

export const sysScript = {
  saveSysScriptInfoApi: (params) => {
    return http.post(`${apiBefore}/sys/script/save`, params)
  },
  getSysScriptInfoApi: (params) => {
    return http.get(`${apiBefore}/sys/script/` + params.id + '/info', { params })
  },
  updateSysScriptInfoApi: (params) => {
    return http.put(`${apiBefore}/sys/script/` + params.id + '/update', params)
  },
  deleteSysScriptInfoApi: (params) => {
    return http.delete(`${apiBefore}/sys/script/` + params.id + '/delete', params)
  },
  getSysScriptList: (params) => {
    return http.get(`${apiBefore}/sys/script/list`, params)
  },
  getSysScriptInfoList: (params) => {
    return http.get(`${apiBefore}/sys/script/select-list`, params)
  },
  getSysScriptLogList: (params) => {
    return http.get(`${apiBefore}/sys/script/${params.id}/log`)
  }
}
export const sysBot = {
  getTriggerList: (params) => {
    return http.get(`${apiBefore}/sys/script/list`, { params })
  },
  getBotScriptList: (params) => {
    return http.get(`${apiBefore}/sys/bot-script/`, params)
  }
}
